package com.mlnx.work.pojo.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.text.SimpleDateFormat;

/**
 * @Author: Akrio
 * @Date: 2021-01-30 15:51
 */
@Data
@ApiModel("生成任务表单参数类")
public class UploadTaskVO {

    @ApiModelProperty(value = "编号")
    @NotEmpty(message = "编号不能为空")
    private String itemNo;

    @ApiModelProperty(value = "类别")
    @NotEmpty(message = "类别不能为空")
    private String type;

    @ApiModelProperty(value = "名称")
    @NotEmpty(message = "名称不能为空")
    private String name;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty("计划起始时间")
    @NotNull(message = "起始时间不能为空")
    private String  originStartTime;

    @ApiModelProperty("计划结束时间")
    @NotNull(message = "结束时间不能为空")
    private String originEndTime;

    @ApiModelProperty("实际开始时间")
    private String startTime;

    @ApiModelProperty("实际完成时间")
    private String completedTime;

    @ApiModelProperty("拟逾期完成时间")
    private String overdueTime;

    @ApiModelProperty("逾期比")
    private Float overdueRate;

    @ApiModelProperty("逾期次数")
    private Integer overdueTimes;

    @ApiModelProperty("工时")
    private Integer workHour;

    @ApiModelProperty("风险项")
    private String risk;

    @ApiModelProperty(value = "交付成果")
    private String achievement;

    @ApiModelProperty("标签")
    private String tags;

    @ApiModelProperty("里程碑")
    @NotNull(message = "里程碑不能为空")
    private Integer milepost;

    @ApiModelProperty("负责人")
    @NotNull(message = "负责人不能为空")
    private String  manager;

    @ApiModelProperty(value = "所属单机")
    private String parent;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty("成员")
    private String member;


    SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");


    public void setOriginStartTime(Long time){
        if(time==null || time==0 ){
            originStartTime="";
        }else {
            originStartTime=sd.format(time);
        }
    }
    public void setStartTime(Long time){
        if(time==null || time==0 ){
            startTime="";
        }else {
            startTime=sd.format(time);
        }
    }
    public void setCompletedTime(Long time){
        if(time==null || time==0 ){
            completedTime="";
        }else {
            completedTime=sd.format(time);
        }

    }
    public void setOriginEndTime(Long time){
        if(time==null || time==0 ){
            originEndTime="";
        }else {
            originEndTime=sd.format(time);
        }
    }
    public void setOverdueTime(Long time){
        if(time==null || time==0 ){
            overdueTime="";
        }else {
            overdueTime=sd.format(time);
        }

    }

}
